<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="spring" uri="http://www.springframework.org/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="structure" /></title>
</head>
<body>
    <h1><fmt:message key="structure" /></h1>
    <c:url var="updateUrl" value="/domain/structure/update.action"/>
    <form:form action="${updateUrl}" id="structureForm" modelAttribute="structureForm" >
        <form:errors cssClass="error"/>
        <table>
            <form:hidden path="structure.inode"/>
            <tbody>
                <tr>
                    <th><fmt:message key="structure_structuretype" /></th>
                    <td>
						<c:out value="${structureForm.structure.structureType}" />
                    </td>
                </tr>

                <tr>
                    <th><fmt:message key="structure_name" /></th>
                    <td>
                        <form:input path="structure.name"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "structure.name",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="structure.name"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="structure_description" /></th>
                    <td>
                        <form:input path="structure.description"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "structure.description",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="structure.description"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="structure_reviewInterval" /></th>
                    <td>
                        <form:input path="structure.reviewInterval"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "structure.reviewInterval",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="structure.reviewInterval"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="structure_reviewerRole" /></th>
                    <td>
                        <form:input path="structure.reviewerRole"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "structure.reviewerRole",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="structure.reviewerRole"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="structure_pageDetail" /></th>
                    <td>
                        <form:input path="structure.pageDetail"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "structure.pageDetail",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                    ,regExp : "[-+]?[0-9]+(\.[0-9]+)?"
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="structure.pageDetail"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="structure_velocityVarName" /></th>
                    <td>
                        <c:out value="${structureForm.structure.velocityVarName}"/>
                    </td>
                </tr>

            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2">
                        <div class="buttons">
                            <button id="updateButton" type="submit"><fmt:message key="label.form.submit"/></button>
                            <script type="text/javascript">
                                Spring.addDecoration(new Spring.ValidateAllDecoration({
                                    elementId:'updateButton',
                                    event:'onclick'
                                }));
                            </script>
                            <c:url var="showUrl" value="/domain/structure/show.action">
                                <c:param name="structure.inode" value="${structureForm.structure.inode}"/>
                            </c:url>
                            <a href="${showUrl}"><span><fmt:message key="label.link.show"/></span></a>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form:form>
</body>
